package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.AppNewsDetailed;
import com.ruoyi.system.mapper.AppNewsDetailedMapper;
import com.ruoyi.system.service.IAppNewsDetailedService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 14254
 * @Date2023/3/16 14:20
 **/
@Service
public class  AppNewsDetailedServiceImpl extends ServiceImpl<AppNewsDetailedMapper, AppNewsDetailed> implements IAppNewsDetailedService
{

    @Resource
    private AppNewsDetailedMapper appNewsDetailedMapper;

    /**
     * 查询新闻
     *
     * @param id 新闻主键
     * @return 新闻
     */
    @Override
    public AppNewsDetailed selectAppNewsDetailedById(Long id)
    {
        return appNewsDetailedMapper.selectAppNewsDetailedById(id);
    }
    @Override
    public AppNewsDetailed selectByTitileAndType(String title,String newsTypeName)
    {
        return appNewsDetailedMapper.selectByTitileAndType(title,newsTypeName);
    }

    /**
     * 查询新闻列表
     *
     * @param appNewsDetailed 新闻
     * @return 新闻
     */
    @Override
    public List<AppNewsDetailed> selectAppNewsDetailedList(AppNewsDetailed appNewsDetailed)
    {

        return appNewsDetailedMapper.selectAppNewsDetailedList(appNewsDetailed);
    }

    /**
     * 新增新闻
     *
     * @param appNewsDetailed 新闻
     * @return 结果
     */
    @Override
    public int insertAppNewsDetailed(AppNewsDetailed appNewsDetailed)
    {
         return appNewsDetailedMapper.insertAppNewsDetailed(appNewsDetailed);
    }

    /**
     * 修改新闻
     *
     * @param appNewsDetailed 新闻
     * @return 结果
     */
    @Override
    public int updateAppNewsDetailed(AppNewsDetailed appNewsDetailed)
    {
        return appNewsDetailedMapper.updateAppNewsDetailed(appNewsDetailed);
    }


    /**
     * 删除新闻信息
     *
     * @param id 新闻主键
     * @return 结果
     */
    @Override
    public int deleteAppNewsDetailedById(Long id)
    {
        return appNewsDetailedMapper.deleteAppNewsDetailedById(id);
    }

    @Override
    public List<AppNewsDetailed> findList(AppNewsDetailed appNewsDetailed){
        return  appNewsDetailedMapper.findList(appNewsDetailed);
    }

}
